package app.common;

public class GlobalConstants {

	public static final String APP_NAME = "testjava";

	public static String key_DBCONN_METHOD = "dbconn_method";
	public static final String value_DBCONN_METHOD_DRIVERMANABER = "drivermanager";
	public static final String value_DBCONN_METHOD_JNDI = "jndi";

	public static final String key_databaseMode = "DATABASE_MODE";
	public static final String value_databaseMode_embedded = "embedded";
	public static final String value_databaseMode_clientserver = "clientserver";

	public static final String key_appMode = "APP_MODE";
	public static final String value_appMode_desktop = "desktop";
	public static final String value_appMode_browser = "browser";
	public static final String value_appMode_backup = "backup";
	public static final String value_appMode_restore = "restore";

	static {
		// init app mode
		PropertyUtil.put(GlobalConstants.key_appMode, GlobalConstants.value_appMode_browser);
		// init database mode
		PropertyUtil.put(GlobalConstants.key_databaseMode,
				GlobalConstants.value_databaseMode_embedded);
		// init db conn mode
		PropertyUtil.put(GlobalConstants.key_DBCONN_METHOD,
				GlobalConstants.value_DBCONN_METHOD_DRIVERMANABER);
	}

	public static void listCurrent() {
		System.out.println(GlobalConstants.key_appMode + "="
				+ PropertyUtil.get(GlobalConstants.key_appMode));
		System.out.println(GlobalConstants.key_databaseMode + "="
				+ PropertyUtil.get(GlobalConstants.key_databaseMode));
		System.out.println(GlobalConstants.key_DBCONN_METHOD + "="
				+ PropertyUtil.get(GlobalConstants.key_DBCONN_METHOD));
	}
}
